<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Insert title here</title>
		<script type="text/javascript" src="../../static/jquery/jquery-2.0.3.js"></script>
		<script type="text/javascript" src="../../static/jquery/jquery.cookie.js"></script>
		<script type="text/javascript">
			var csrfToken=$.cookie("csrftoken");
			function csrfSafeMethod(method){
				//these http methods do not require csrf protection 
				return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
			}

			$.ajaxSetup({
				beforeSend: function(xhr, settings){
					if (!csrfSafeMethod(settings.type) && !this.crossDomain){
						xhr.setRequestHeader("X-CSRFToken",csrfToken);
					}
				}
			});
			function Do(){
				$.ajax({
					url:"/app06/login/",
					data:{'username':1,'passwd':'123'},
					type:'POST',
					success:function(data){
						console.log(data);
					}
				})
			}
		</script>
	</head>
	<body>
		<form action="/app06/login/" method="POST">
			{%csrf_token%}		
			<p>用户名：<input name="username" /></p>
			<p>密码：<input name="passwd" /></p>
			<input type="submit"  value="提交">
			<label style="color: red">{{msg}}</label>
		</form>
		
	</body>
</html>